import Vue from 'vue'
import App from './App'
import config from '@/common/config'
import noData from 'components/no-data.vue'
import calc from '@/common/calc.js'
import isVideo from '@/common/calc.js'
import { myPatch } from './static/libs/extendWeixin';
Vue.prototype.__patch__ = myPatch;
Vue.config.isVideo = isVideo
Vue.config.productionTip = false
Vue.prototype.baseImgUrl = config.baseImgUrl

App.mpType = 'app'

// 引入全局uView
// import uView from 'uview-ui'

// 引入全局uView
import uView from '@/uni_modules/uview-ui'

Vue.use(uView);

//把无数据组件在这里导入
Vue.component('no-data', noData);

import titleContent from 'components/global/title-content.vue'
Vue.use(titleContent);

import store from '@/store';

// 引入uView提供的对vuex的简写法文件
// let vuexStore = require('@/store/$u.mixin.js');
// Vue.mixin(vuexStore);

import share from '@/mixins/share.js'
Vue.mixin(share)

import * as filters from '@/common/filters'
for(const key in filters){
	Vue.filter(key, filters[key])
}


const app = new Vue({
	store,
    ...App
})

// http拦截器，将此部分放在new Vue()和app.$mount()之间，才能App.vue中正常使用
// import httpInterceptor from '@/common/http.interceptor.js';
// Vue.use(httpInterceptor, app);

require('@/common/http.interceptor')(app);

// http接口API抽离，免于写url或者一些固定的参数8
import httpApi from '@/common/http.api.js';
Vue.use(httpApi, app);

app.$mount()

